var GTouchLayer = cc.Layer.extend({
	clean : false,
	ctor : function(number){
		this._super();
		this.initMenu(number);
	},
	initMenu : function(number) {
		MoveRes = "res/move.png";
		var prevNormal = new cc.Sprite(MoveRes, cc.rect(500, 200, 100, 100));
		var prevSelected = new cc.Sprite(MoveRes, cc.rect(500, 200, 100, 100));
		var prevDisabled = new cc.Sprite(MoveRes, cc.rect(500, 200, 100, 100));
		var prevAction;

		var nextNormal = new cc.Sprite(MoveRes, cc.rect(600, 200, 100, 100));
		var nextSelected = new cc.Sprite(MoveRes, cc.rect(600, 200, 100, 100));
		var nextDisabled = new cc.Sprite(MoveRes, cc.rect(600, 200, 100, 100));
		var nextAction;
		
		var backNormal = new cc.Sprite(MoveRes, cc.rect(700, 100, 100, 100));
		var backSelected = new cc.Sprite(MoveRes, cc.rect(700, 100, 100, 100));
		var backDisabled = new cc.Sprite(MoveRes, cc.rect(700, 100, 100, 100));
		var backAction;
		
		backAction = function(){
			cc.director.runScene(new cc.TransitionPageTurn(1.2, new MainMenuScene(),true));
		};
		
		switch(number){
		case 0:{
			prevAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new MainMenuScene(),true));
			};
			nextAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(1),false));
			};
			break;
		}
		case 1:{
			prevAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(0),true));
			};
			nextAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(2),false));
			};
			break;
		}
		case 2:{
			prevAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(1),true));
			};
			nextAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(3),false));
			};
			break;
		}
		case 3:{
			prevAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(2),true));
			};
			nextAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(4),false));
			};
			break;
		}
		case 4:{
			prevAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(3),true));
			};
			nextAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(5),false));
			};
			break;
		}
		case 5:{
			prevAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(4),true));
			};
			nextAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(6),false));
			};
			break;
		}
		case 6:{
			prevAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(5),true));
			};
			nextAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(7),false));
			};
			break;
		}
		case 7:{
			prevAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(6),true));
			};
			nextAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(8),false));
			};
			break;
		}
		case 8:{
			prevAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(7),true));
			};
			nextAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(9),false));
			};
			break;
		}
		case 9:{
			prevAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(8),true));
			};
			nextAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(10),false));
			};
			break;
		}
		case 10:{
			prevAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new GuideMenuScene(9),true));
			};
			nextAction = function(){
				cc.director.runScene(new cc.TransitionPageTurn(1.2, new MainMenuScene(),true));
			};
			break;
		}
		}
		var prevMenu = new cc.MenuItemSprite(
				prevNormal,prevSelected,prevDisabled,
				prevAction,this);
		var nextMenu = new cc.MenuItemSprite(
				nextNormal,nextSelected,nextDisabled,
				nextAction,this);
		var backMenu = new cc.MenuItemSprite(
				backNormal,backSelected,backDisabled,
				backAction,this);
		var menu = new cc.Menu();
		prevMenu.setPosition(200,960-800);
		nextMenu.setPosition(450,960-800);
		backMenu.setPosition(80,960-800);
		menu.setPosition(0, 0);
		menu.addChild(prevMenu);
		menu.addChild(nextMenu);
		menu.addChild(backMenu);
		nextMenu.setPosition(500,960-800);
		this.addChild(menu);
	}
}); 